<!-- 会话列表 -->
<?php $rand = round(microtime(true),3)*1000;?>
<table id="sessionList_{$rand}" class="easyui-datagrid" title="{$currentpos}" data-options="
	fit:true,rownumbers:true,animate:true,fitColumns:true,
	url:'{:U('trade/index',array('uid'=>I('id',0)))}',idField:'id',border:false,
	toolbar:'#sessionToolbar_{$rand}',pagination:true,singleSelect:true,pageSize:20,nowrap:false">
    <thead>
    <tr>
        <th data-options="field:'headsmall',width:20,align:'center',formatter:buildFace">头像</th>
        <th data-options="field:'nickname',width:10,align:'left'">用户名</th>
        <th data-options="field:'type_text',width:20,align:'center'">详情</th>
        <th data-options="field:'score',width:10,align:'center'">金额</th>
        <th data-options="field:'create_time',width:50">创建时间</th>
    </tr>
    </thead>
</table>

<div id="sessionToolbar_{$rand}" style="padding:5px;height:auto">
    <form id="sessionSearchForm_{$rand}">
        <a href="javascript:;" onclick="sessionRefreshList_{$rand}();" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
    </form>
</div>

<!-- 编辑 -->
<div id="sessionEditBox" class="easyui-dialog" title="编辑会话"
     data-options="modal:true,closed:true,iconCls:'icon-add',
				buttons:[{text:'确定',iconCls:'icon-ok',
				handler:function(){$('#sessionEditForm').submit();}},
				{text:'取消',iconCls:'icon-cancel',
				handler:function(){$('#sessionEditBox').dialog('close');}}]"
     style="width: 600px; height: 280px;"></div>


<div id="pushEditBox" class="easyui-dialog" title="编辑会话推送"
     data-options="modal:true,closed:true,iconCls:'icon-add',
				buttons:[{text:'确定',iconCls:'icon-ok',
				handler:function(){$('#pushConfigEditForm').submit();}},
				{text:'取消',iconCls:'icon-cancel',
				handler:function(){$('#pushEditBox').dialog('close');}}]"
     style="width: 600px; height: 280px;"></div>s

<script type="text/javascript">
    //刷新
    function sessionRefreshList_{$rand}(){
        $('#sessionList_{$rand}').datagrid('reload');
    }
    //logo显示
    function buildFace(val,row,index){
        if(!val){
            return '<div style="height:60px;padding:3px;margin:auto;"></div>';
        }else{
            return '<img src="'+val+'" height="60" style="padding:3px;">';
        }
    }
    //操作格式化
    function sessionOperateText(val, row, index){
        var btn = [];
        btn.push('<a href="javascript:void(0);" onclick="sessionEdit('+val+')">编辑</a>');
        btn.push('<a href="javascript:void(0);" onclick="sessionDelete('+val+','+row.uid+')">删除</a>');
//		btn.push('<a href="javascript:void(0);" onclick="pushConfig('+val+','+row.uid+')">设置推送</a>');
        return btn.join(' | ');
    }
</script>